<?php
if(isset($_POST["offset"])){
	$offset=$_POST["offset"];
}
else{
	$offset=0;
}

if(isset($_POST["queryType"])){
	$type=$_POST["queryType"];
}
else{
	$type="normal";
}

$count=10;

$res=query_post($count,$offset);


if($type=="getCount"){
	if(!$res){
		die("{\"result\":\"failed\"}");
	}
	else{
		$count=mysql_num_rows($res);
		echo "{\"result\":\"success\",\"count\":\"".$count."\"}";
		exit;
	}
}
?>
<?php while($row=mysql_fetch_array($res)){?>
<li class='home_post new_post round-top round-bottom'>
<?php echo $row["content"]?>
<?php require 'post_addi.php';?>
</li>
<?php }?>